package com.retail.order.controller;

import com.retail.order.util.AliOSSUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class OssController {

    @Autowired
    private AliOSSUtils aliOSSUtils;

    /**
     * 图片上传
     * @param file
     * @return
     * @throws IOException
     */
    @PostMapping("upd")
    public String upd(@RequestParam("file") MultipartFile file) throws IOException {
        return aliOSSUtils.upload(file);
    }


}
